package cn.poco.pepsi.util;

import java.io.InputStream;

import org.xmlpull.v1.XmlPullParser;

import android.util.Xml;

public class ResponseResult {
	public static boolean parseXML(InputStream inputStream) throws Exception {
		String result = null;
		XmlPullParser parser = Xml.newPullParser();
		parser.setInput(inputStream, "UTF-8");
		int event = parser.getEventType();
		while(event!=XmlPullParser.END_DOCUMENT){
			switch (event) {
			case XmlPullParser.START_TAG:
				if("result".equals(parser.getName())){
					result = parser.nextText();
				}
				break;
			}
			event = parser.next();
		}
		inputStream.close();
		if("0000".equals(result)){
			return true;
		}else{
			return false;
		}		
	}
}
